<template>
  <div class="about">
    <div>
      姓名：<span>{{patientDetail.name}}</span>
    </div>
    <div>
      性别：<span>{{patientDetail.sex === '1' ? '男' : '女'}}</span>
    </div>
    <div>
      文化程度：<span>
       {{{'1':'无','2':'小学','3':'初中','4':'高中','5':'大专以上','999':'其他'}[patientDetail.culture_level]}} 
      </span>
    </div>
    <div>
      婚姻：<span>
               {{{'1':'未婚','2':'已婚','3':'丧偶','4':'离异','999':'其他'}[patientDetail.is_married]}} 
      </span>
    </div>
    <div>
      民族：<span>{{patientDetail.nation}}</span>
    </div>
    <div>
      职业：<span>{{patientDetail.job}}</span>
    </div>
    <div>
      身高：<span>{{patientDetail.height}}</span>
    </div>
    <div>
      体重：<span>{{patientDetail.weight}}</span>
    </div>
    <div>
      联系地址：<span>{{patientDetail.address}}</span>
    </div>
    <div>
      患者电话：<span>{{patientDetail.mobile}}</span>
    </div>
    <div>
      入院时间：<span>{{patientDetail.inner_hospital_time}}</span>
    </div>
    <div>
      主管医师：<span>{{patientDetail.master_doctor}}</span>
    </div>
    <div>
      入院方式：<span>
        {{{'1':'平车','2':'轮椅','3':'步行','999':'其他'}[patientDetail.inner_hospital_style]}} 
      </span>
    </div>
    <div>
      出院时间：<span>
        {{patientDetail.outer_hospital_time}}
      </span>
    </div>
    <div>
      主要照顾者与患者的关系：<span>
        {{patientDetail.master_watcher_linked}}
      </span>
    </div>
    <div>
      照顾者性别：<span>
        {{patientDetail.watcher_sex === '1' ? '男' : '女'}}
      </span>
    </div>
    <div>
      照顾者文化程度：<span>
        {{{'1':'无','2':'小学','3':'初中','4':'高中','5':'大专以上','999':'其他'}[patientDetail.watcher_culture_level]}} 
      </span>
    </div>
    <div>
      照顾者电话：<span>
        {{patientDetail.watcher_mobile}}
      </span>
    </div>
    <div>
      既往健康状况：<span>
      {{{'1':'高血压','2':'高血脂','3':'高血糖','4':'心脏病','999':'无'}[patientDetail.last_health_state]}} 
      </span>
    </div>
    <div>
      目前服用药物：<span>{{patientDetail.current_medication}}</span>
    </div>
  </div>
</template>
<script>
export default{
  data(){
    return {
      patientDetail:{}
    }
  },
  created(){
    document.title = '患者详情'; 
    //console.log(this.$route.params.id)
    this.getPatientDetail()
  },
  methods:{
    async getPatientDetail() {
        try {
          let {
            data: res
          } = await this.$http.post('/api/patient/getOne', {
            id:this.$route.params.id
          })
          //console.log(res.data)
          if(res.statusCode !== 0){
            return console.log('失败')
          }
          this.patientDetail = res.data
        } catch (e) {
          //console.log(e.toString())
          //this.showNetError = true
          return {
            error:true
          }
        }
      }
  }
}
</script>
<style lang="less" scoped>
.about{
  padding: 5px 20px;
  text-align: left;
  >div{
    padding-top:10px;
    font-size: 14px;
  }
}
</style>
